{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}TestBrain - 测试用例管理平台{% endblock %}</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
    <link href="https://cdn.jsdelivr.net/npm/select2-bootstrap-theme@0.1.0-beta.10/dist/select2-bootstrap.min.css" rel="stylesheet" />
    <style>
        /* 左侧导航栏样式 */
        .sidebar {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            z-index: 100;
            padding: 0;
            box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
            background-color: #f8f9fa;
            width: 200px;
        }

        /* 品牌标题样式 */
        .brand-title {
            padding: 0.8rem 1rem;
            font-size: 1.25rem;
            font-weight: 500;
            color: #333;
            margin: 0;
            line-height: 1.5;
            border-bottom: 1px solid #dee2e6;
            text-align: left;
            display: block;
            width: 100%;
        }

        .sidebar .nav-link {
            font-weight: 500;
            color: #333;
            padding: 0.8rem 1rem;
            text-align: left;
        }

        .sidebar .nav-link:hover {
            color: #007bff;
            background-color: #e9ecef;
        }

        .sidebar .nav-link.active {
            color: #007bff;
        }

        .sidebar .nav-link i {
            margin-right: 8px;
            width: 20px;
            text-align: center;
        }

        /* 主内容区域样式 */
        .main-content {
            margin-left: 200px;
            padding: 20px 30px;
        }

        /* 导航菜单样式 */
        .nav-menu {
            padding: 0;
            margin: 0;
        }

        .nav-menu .nav {
            padding: 0;
            margin: 0;
        }

        .nav-menu .nav-item {
            width: 100%;
        }
    </style>
    {% block extra_css %}{% endblock %}
</head>
<body>
    <!-- 左侧导航栏 -->
    <nav class="sidebar">
        <!-- 品牌标题 -->
        <div class="brand-title">
            TestBrain
        </div>
        
        <!-- 导航菜单 -->
        <div class="nav-menu">
            <ul class="nav flex-column">
                <li class="nav-item">
                    <a class="nav-link {% if request.path == '/' %}active{% endif %}" href="/">
                        <i class="fas fa-home"></i>
                        首页
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link {% if '/generate/' in request.path %}active{% endif %}" href="/generate/">
                        <i class="fas fa-plus-circle"></i>
                        测试用例生成
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link {% if '/review/' in request.path %}active{% endif %}" href="/review/">
                        <i class="fas fa-check-circle"></i>
                        测试用例评审
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link {% if '/upload/' in request.path %}active{% endif %}" href="/upload/">
                        <i class="fas fa-upload"></i>
                        项目文档上传到知识库
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link {% if '/analyser/' in request.path %}active{% endif %}" href="/analyser/">
                        <i class="fas fa-upload"></i>
                        测试点&测试场景分析
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link {% if '/knowledge/' in request.path %}active{% endif %}" href="/knowledge/">
                        <i class="fas fa-book"></i>
                        知识库管理(暂时不支持)
                    </a>
                </li>
            </ul>
        </div>
    </nav>

    <!-- 主内容区域 -->
    <main class="main-content">
        {% block content %}{% endblock %}
    </main>

    <script src="{% static 'js/extra/jquery.min.js' %}"></script>
    <!-- <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.bundle.min.js"></script> -->
    <!-- <script src="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.4/js/all.min.js"></script> -->
     <!-- 修改为使用本地文件 -->
    <script src="{% static 'js/extra/all.min.js' %}"></script>
    <script src="{% static 'js/extra/bootstrap.bundle.min.js' %}" data-no-maps></script>
    <!-- <script src="https://cdn.bootcdn.net/ajax/libs/bootstrap-select/1.13.14/js/bootstrap-select.min.js"></script> -->
    <script src="{% static 'js/extra/bootstrap-select.min.js' %}" data-no-maps></script>
    <script src="{% static 'js/extra/select2.min.js' %}" data-no-maps></script>
    <script>
        $(document).ready(function() {
            $('.selectpicker').selectpicker({
                style: 'btn-default',
                noneSelectedText: '请选择',
                liveSearch: true,
                showTick: true,
                actionsBox: true
            });
        });
    </script>
    {% block extra_js %}{% endblock %}
</body>
</html> 